<!--处理提测记录弹出框-->
<script type="text/ng-template" id="editionIntegrationTemplate.html">
    <style>
        .edition_click {
            background-color: greenyellow;
        }

        .modal-content {
            width: 1350px;
            right: 380px;
        }
    </style>
    <div class="modal-header">
    </div>
    <div class="modal-body">
        <uib-accordion close-others="false">
            <uib-accordion-group heading="工程信息" is-open="true">
                <table class="table table-hover table-bordered text-center">
                    <tr>
                        <td>项目:</td>
                        <td>{{info.projectInfo.plan_name}}</td>
                    </tr>
                    <tr>
                        <td>工程名:</td>
                        <td>{{info.projectName}}</td>
                    </tr>
                    <tr>
                        <td>
                            <span ng-if="info.type=='TEST'">当前功能测试版本:</span>
                            <span ng-if="info.type=='INTEGRATION'">当前集成测试版本:</span>
                            <span ng-if="info.type=='CAN_INTEGRATION' || info.type=='SEARCH'">当前可集成版本:</span>
                        </td>
                        <td>
                            <span ng-if="info.type=='TEST'">{{info.projectInfo.testing_edition}}</span>
                            <span ng-if="info.type=='INTEGRATION'">{{info.projectInfo.integrationing_edition}}</span>
                            <span ng-if="info.type=='CAN_INTEGRATION' || info.type=='SEARCH'">{{info.projectInfo.integration_edition}}</span>
                        </td>
                    </tr>
                </table>
            </uib-accordion-group>
            <uib-accordion-group heading="提交记录(点击版本号查看记录详情)" is-open="true">
                <table class="table table-hover table-bordered text-center">
                    <thead>
                    <tr>
                        <th width="1%">提交时间</th>
                        <th width="1%">版本号</th>
                        <th width="1%">提交人</th>
                        <th width="1%">解决阻塞bug</th>
                        <th width="2%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="i in info.recordList track by $index"
                        ng-class="{true:'edition_click',false:''}[i.click]">
                        <td>{{i.create_date| create_date_filter}}</td>
                        <td>
                            <a href="javascript:void(0)" ng-click="clickRecord(i);">{{i.edition_num}}</a>
                        </td>
                        <td>
                            {{i.hand_realname}}
                        </td>
                        <td>
                            <span ng-if="i.is_handle_bug == '0'" style="color: red;">是</span>
                            <span ng-if="i.is_handle_bug == '1'">否</span>
                        </td>
                        <td>
                            <span ng-if="i.is_cancel == '1'">
                                <span ng-if="info.type == 'CAN_INTEGRATION' && isUserCanOperateByRole('plan_admin','pm') && info.projectInfo.to_integration_edition == i.edition_num && i.is_can_integration == null">
                                    <a href="javascript:void(0);" ng-click="operateFun(i,true);">批准集成</a>
                                    <a href="javascript:void(0);" ng-click="operateFun(i,false);">不可集成</a>
                                </span>
                                <span ng-if="info.type == 'CAN_INTEGRATION' && i.is_can_integration == '0'">已经批准集成</span>
                                <span ng-if="i.is_can_integration == '1'" style="color: red;">已不允许进入集成环境</span>
                                <a href="javascript:void(0);"
                                   ng-if="info.type == 'INTEGRATION' && i.is_can_integration == '0' && isUserCanOperateByRole('qa')"
                                   ng-click="operateFun(i);">集成测试</a>
                                <span ng-if="info.type == 'INTEGRATION' && i.is_can_integration == null"
                                      style="color: red;">尚未批准进入集成环境</span>
                                <a href="javascript:void(0);"
                                   ng-if="info.type == 'TEST' && isUserCanOperateByRole('qa')"
                                   ng-click="operateFun(i);">功能测试</a>
                            </span>
                            <span style="color: red;" ng-if="i.is_cancel == '0'">
                                已取消
                            </span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </uib-accordion-group>
            <uib-accordion-group ng-if="info.status && info.selectRecord != null" heading="附加说明" is-open="true">
                <uib-accordion close-others="false">
                    <uib-accordion-group heading="提交说明(这次提交的修改点,测试点以及注意事项)" is-open="true">
                        <div>
                            <textarea wrap="off" style="overflow-y:scroll;width: 100%;" readonly
                                      ng-model="info.selectRecord.other_desc" rows="2"></textarea>
                        </div>
                    </uib-accordion-group>
                    <uib-accordion-group heading="SQL变动" is-open="true">
                        <div>
                            <div style="max-height: 200px;overflow-y: auto;">
                                <span ng-if="info.selectRecord.sqlList.length == 0" style="color: red;">没有sql脚本</span>
                                <table class="table table-hover table-bordered text-center"
                                       ng-if="info.selectRecord.sqlList.length > 0">
                                    <tbody>
                                    <tr ng-repeat="sql in info.selectRecord.sqlList track by $index">
                                        <td>
                                            <a href="javascript:void(0)" ng-click="downloadSqlFile(sql);">{{sql.file_name}}(点击下载)</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </uib-accordion-group>
                    <uib-accordion-group heading="配置变动" is-open="true">
                        <div>
                            <div style="max-height: 200px;overflow-y: auto;">
                                <span ng-if="info.selectRecord.configList.length == 0" style="color: red;">没有配置项</span>
                                <table class="table table-hover table-bordered text-center"
                                       ng-if="info.selectRecord.configList.length > 0">
                                    <thead>
                                    <tr>
                                        <th>
                                            配置文件
                                        </th>
                                        <th>
                                            配置项
                                        </th>
                                        <th>
                                            配置说明
                                        </th>
                                    </tr>
                                    <tbody>
                                    <tr ng-repeat="config in info.selectRecord.configList track by $index">
                                        <td>
                                            {{config.fileName}}
                                        </td>
                                        <td>
                                            {{config.key}}={{config.value}}
                                        </td>
                                        <td>
                                            <span>{{config.desc}}</span>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </uib-accordion-group>
                </uib-accordion>
            </uib-accordion-group>
        </uib-accordion>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel();">关闭</button>
    </div>
</script>